package threads.volatiletest;

import java.util.concurrent.atomic.AtomicInteger;


public class TestAtomicVisibility
{

//private AtomicInteger serialNumber = new AtomicInteger(0);

	
	
	
	public int nextSerialNumber()
	{
		 AtomicInteger serialNumber = new AtomicInteger(0);
		System.out.println("serialNumber=" + serialNumber + " " + (Thread.currentThread().getName()));
		return serialNumber.incrementAndGet();
		//return serialNumber++;
	}
	
}
